//创建一个路由器，并暴露出去

//第一步：引入createRouter
import {createRouter,createWebHistory } from "vue-router";
 //第二步：引入一个一个可能要呈现的组件
 import discover from '@/router/discover.vue';
 import release from '@/router/release.vue';
 import notice from '@/router/notice.vue';
 import me from '@/router/me.vue';
 import more from '@/router/more.vue';
 import detail from '@/router/detail.vue'
 //第二部：创建路由器
 const router = createRouter({
    history:createWebHistory(),//路由器的工作模式
    routes:[//路由规则
        {
            path:'/', 
            redirect:'/discover'
        },
        {
            path:'/discover',
            component:discover,
            children:[
                       
                {
                    path:'detail', //子集路由不需要加路径
                    component:detail
                }
            ]
           
        },
        {
            path:'/release',
            component:release
        },
        {
            path:'/notice',
            component:notice
        },
        {
            path:'/me   ',
            component:me
        },
        {
            path:'/more',
            component:more
        }
    ]
 })

 //把路由暴露出去
 export default router